package src;

/**
 * 优先队列
 */
public class PriorityQueue<E extends Comparable<E>> implements Queue<E> {

    private MaxHeap<E> maxHeap;
    public PriorityQueue(){
        maxHeap = new MaxHeap<>();
    }

    @Override
	public int getSize() {
		return maxHeap.getSize();
	}

	@Override
	public boolean isEmpty() {
		return maxHeap.isEmpty();
	}

	@Override
	public E deQueue() {
		return maxHeap.popMax();
	}

	@Override
	public E getFront() {
		return maxHeap.getMax();
	}

    @Override
    public void enQueue(E e) {
        maxHeap.add(e);
    }

}